package com.dao.imp;

import com.dao.DistributionDao;
import com.dao.core.DaoBaseImp;
import com.pojo.Distribution;

public class DistributionDaoImp extends DaoBaseImp<Distribution> implements DistributionDao{

	@Override
	public Distribution getDistributionById(int id) {
		return (Distribution)getSession().get(Distribution.class, id);
	}

	@Override
	public boolean updateDistribution_broken(Integer id, String broken) {
		int d =update("update Distribution as d set d.broken='"+broken +"' where d.id="+id);
		this.getSession().flush();
		if( d>0)
			return true;
		else{
			return false;
		}
	}

	@Override
	public boolean updateDistribution_empty(Integer id, String empty) {
		int d =update("update Distribution as d set d.empty='"+empty +"' where d.id="+id);
		this.getSession().flush();
		if( d>0)
			return true;
		else{
			return false;
		}
	}

	
	
}
